//package common.fengkai.filepost.utils;
//import com.alibaba.fastjson.JSON;
//import com.alibaba.fastjson.JSONObject;
//import com.kinggrid.ws.PdfInfoService;
//import common.fengkai.filepost.VO.CheckPdfDTO;
//import org.apache.cxf.endpoint.Client;
//import org.apache.cxf.frontend.ClientProxy;
//import org.apache.cxf.transport.http.HTTPConduit;
//import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
//import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
//
//import java.io.IOException;
//import java.nio.file.Files;
//import java.nio.file.Paths;
//import java.util.Objects;
//
//public class CheckTest {
//    public   void checkPdf() throws IOException, Exception {
//        //String url = "http://10.0.100.57:7001/iSignatureWebPDF/services/PdfActionService";
//        //String url = "http://10.29.31.124:8002/eseal//iSignatureWebPDF/services/PdfInfoWebService"; // 网关 http://10.29.31.61:8882/eseal/eseal/app/services/signPdf
//        //String url = "http://10.29.31.58:8002/eseal//iSignatureWebPDF/services/PdfInfoWebService";
//        //String url = "http://10.29.31.121:8882/eseal/eseal//iSignatureWebPDF/services/PdfInfoWebService";
//
//        //生产（http://10.30.48.249） uat（http://10.29.28.3）
//        String url = "http://10.29.28.3/eseal/eseal//iSignatureWebPDF/services/PdfInfoWebService";
//        JaxWsProxyFactoryBean factoryBean = new JaxWsProxyFactoryBean();
//        factoryBean.setServiceClass(PdfInfoService.class);
//        factoryBean.setAddress(url);
//        PdfInfoService pdfInfoService = (PdfInfoService) factoryBean.create();
//
//        Client proxy = ClientProxy.getClient(pdfInfoService);
//        HTTPConduit conduit = (HTTPConduit) proxy.getConduit();
//        conduit.getClient().setReceiveTimeout(0L);
//        HTTPClientPolicy policy = new HTTPClientPolicy();
//        policy.setConnectionTimeout(60000L);
//        policy.setAllowChunking(false);
//        policy.setReceiveTimeout(120000L);
//        conduit.setClient(policy);
//
//        byte[] file = Files.readAllBytes(Paths.get("C:\\Users\\carry\\Desktop\\项目资料\\人管合同8页signed.pdf"));
//
//        if (!Objects.equals("com.ctc.wstx.stax.WstxInputFactory", System.getProperty("javax.xml.stream.XMLInputFactory"))) {
//            System.setProperty("javax.xml.stream.XMLInputFactory", "com.ctc.wstx.stax.WstxInputFactory");
//            System.setProperty("javax.xml.stream.XMLOutputFactory", "com.ctc.wstx.stax.WstxOutputFactory");
//            System.setProperty("javax.xml.stream.XMLEventFactory", "com.ctc.wstx.stax.evt.WstxEventFactory");
//        }
//
//        JSONObject jsonObject = JSONObject.parseObject("{\" swxaSignatureVerify \": true}");
//        String s = JSONObject.toJSONString(jsonObject);
//        System.out.println(s);
//        String s1 = pdfInfoService.getInfo(file, "s");
//        JSONObject jsonObject1 = JSONObject.parseObject(s1);
//        CheckPdfDTO checkPdfDTO = JSON.toJavaObject(jsonObject1, CheckPdfDTO.class);
//        if (checkPdfDTO.isVerifyResult()){
//            System.out.println("结果为真");
//        }else {
//            System.out.println("结果为假");
//        }
//    }
//
//    public static void main(String[] args){
//        CheckTest checkTest = new CheckTest();
//        try {
//            checkTest.checkPdf();
//        } catch (IOException e) {
//            e.printStackTrace();
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//
//
//    }
//
//}
